package main

import "fmt"

func main() {
	var (
		count, sum int
		str        string
		char       rune
	)
	fmt.Scan(&str)
	for _, i := range str {
		sum += 1
		if i == char {
			continue
		}
		count = 1
		for _, j := range str[sum:] {
			if i == j {
				count++
			} else {
				break
			}
		}
		fmt.Print(string(i), count)
		char = i
	}
}
